/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dcds2;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author De Luna, Lin
 */
public class ConnectionFactoryImpl extends ConnectionFactory {
   

    ConnectionFactoryImpl(String driver, String url, String username, String password) {
        this.driver = driver;
        this.url = url;
        this.username = username;
        this.password = password;
    }

    @Override
    public Connection getConnection()
    {
        try
        {
            Class.forName(driver);
            Connection conn = DriverManager.getConnection(url, username, password);
            return conn;
        }
        catch(ClassNotFoundException e){}
        catch(SQLException e){}

        return null;

    }
    
}
